"use strict";

function getParams(a) {
  var t = decodeURI(window.location.search.substring(1)),
      e = t.split("&");for (var _t = 0; _t < e.length; _t++) {
    var n = e[_t].split("=");if (n[0] == a) return n[1];
  }return !1;
}function getRad(t) {
  return t * Math.PI / 180;
}function distance(t, a, e, n) {
  var r = getRad((a + n) / 2),
      a = getRad((a - n) / 2),
      n = getRad((t - e) / 2),
      t = Math.sin(a),
      e = Math.sin(n),
      a = Math.sin(r);return n = (t *= t) * (1 - (e *= e)) + (1 - (a *= a)) * e, r = (1 - t) * (1 - e) + a * e, n = 1e3 <= (n = 2 * (e = Math.atan(Math.sqrt(n / r))) * 6378137 * (1 + 1 / 298.257 * ((3 * (e = Math.sqrt(n * r) / e) - 1) / 2 / r * a * (1 - t) - (3 * e + 1) / 2 / n * (1 - a) * t))) && n <= 99e3 ? (n / 1e3).toFixed(1) + "km" : 99e3 < n ? ">99km" : Math.round(n) + "m";
}function getDistance(t, a) {
  var e = localStorage.getItem("lng"),
      n = localStorage.getItem("lat");return e && n ? distance(parseFloat(t), parseFloat(a), parseFloat(e), parseFloat(n)) : "未准确定位";
}